<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function fepoo(key,index){
            if(key==1){return 1}
            var arr = []
            for(var i =0;i<key;i++){
                arr[i]=1
            }
            // console.log(arr)
            for(var j = key;j<index+1;j++){
                arr[j]=0
                for(var k = 0;k<key;k++){
                    arr[j] +=arr[j-k-1]
                }
            }
            console.log(arr)
        }
        fepoo(2,16)
    </script>
</body>
</html>